<%-- 
    Document   : profiles
    Created on : Dec 10, 2011, 3:46:01 PM
    Author     : THIENSUHACK
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.LinkedList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="GetData.DataWS"%>
<%@page import="DTO.sinhvien"%>

 <% 
 if(session.getAttribute("uid")==null)
         {
     response.sendRedirect("/DKTC/frontend/index.jsp?page=index.jsp"); 
 }
 else
         {
     
 dktc_ws.Sinhvien sv=new dktc_ws.Sinhvien();
 

String id=session.getAttribute("uid").toString();

request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html; charset=UTF-8"); 

    sv.setMasv(id);   
sv.setHoten(request.getParameter("hoten"));   
sv.setGioitinh(Short.valueOf(request.getParameter("gioitinh")));
sv.setDiachi(request.getParameter("diachi"));
sv.setEmail(request.getParameter("email"));
sv.setPhone(request.getParameter("phone"));
sv.setTrangthai(Short.valueOf(request.getParameter("trangthai")));
sv.setNgaysinh(request.getParameter("ngaysinh"));
  
//CharsetFilter ab=new CharsetFilter();
//sv.setHoten(ab.toUTF8(sv.getHoten()));
//sv.setDiachi(ab.toUTF8(sv.getDiachi()));
   int result=0;
   DataWS a=new DataWS(); 
//    Gets a calendar using the default time zone and locale.
   
  result=a.capnhatsinhvien(sv.getMasv(),sv.getHoten(),sv.getGioitinh(),sv.getNgaysinh(),sv.getDiachi(),sv.getEmail(),sv.getPhone(),sv.getMatkhau(),sv.getTrangthai());
   if(result>0)
             {
      
   }
%>

<% } %>
<script>
    window.location="/DKTC/frontend/index2.jsp?page=profiles";
</script>